<template>
	    <h2>我的分数</h2>
		
		<div>
			<table border="1">
				<tr>
					<th>学生编号</th>
					<th>学生姓名</th>
					<th>班级编号</th>
					<th>班级名称</th>
					<th>课程编号</th>
					<th>课程名称</th>
					<th>课程成绩</th>
					<th>录入时间</th>
				</tr>
				<tr v-for="c in data.marks">
					<td align="center">{{c.user.uid}}</td>
					<td align="center">{{c.user.uname}}</td>
					<td align="center">{{c.user.clz.clzno}}</td>
					<td align="center">{{c.user.clz.clzname}}</td>
					<td align="center">{{c.course.cno}}</td>
					<td align="center">{{c.course.cname}}</td>
					<td align="center">{{c.score}}</td>
					<td align="center">{{c.tpostx}}</td>
					
				</tr>
			</table>
			
			
		</div>
</template>

	
<script setup>
import {ref,reactive,onMounted }from 'vue';
import { $get } from '../../ajax';
import {format} from 'date-fns';
	const data= reactive(
	{
		marks:[],
		
	})
		
		onMounted(()=>{
			$get("/api/fore/stu/findMyMark").then((resp)=>{
			   data.marks=resp.data.data;
			   for (var i = 0; i < data.marks.length; i++) {
			   	      let mark= data.marks[i]
					    mark.tpostx= format(mark.tpost,'yyyy年MM月dd日')
			   }
			   console.log(data.marks)
			})	
		})
</script>
	



<style>
</style>
